Learning Objectives

After completing this lesson, you’ll be able to:

Instructions

In this lesson, you will:

Resources

What is the Compare Tool?

One of FME’s strengths is its ability to build complex solutions that apply in multiple departments of an organization. Colleagues often share workspaces and make iterations on those workspaces. Inheriting a workspace from a colleague or working on a workspace together has often resulted in sending files and screenshots back and forth.  The Compare tool saves time and improves this collaborative experience. 

The Compare tool in FME allows you to compare two workspaces simultaneously. These differences are represented visually, allowing you to compare the two workspaces efficiently. You can copy over elements into the Editable canvas to make changes based on the differences. If you want to integrate Git into your Workbench comparison workflow, you can do so on the command line, TortoiseGit, and Sourcetree to interface directly with the Compare tool.

Where Can I Find the Compare Tool?

You can access the Compare tool through File > Compare Files.

This will open the Compare dialog. You can select two workspaces or exported custom transformers you want to compare.

How Does the Compare Tool Work?

Compare has a left (Editable) and right (Read-Only) canvas with edit controls in the middle toolbar. Toggle the Help icon in the toolbar to learn more about using the Compare tool. 

View Workspace Differences

Canvas objects are color-coded to represent their status:

Read-only canvas with highlights

Changes are also displayed below the canvas in a list:

Changes in a list

You can filter this list By Type of Component or By Component Name using the Filter button.

Filter button

Make Changes to Workspaces

You can review the changes and choose which ones to keep. You can also open individual objects and click the Edit... button to selectively change objects on the Editable canvas.

Editing an object on the Editable canvas

If you want to apply all the changes from an object on the Read-Only canvas to the Editable workspace, click an object and choose Copy to Left. This will copy all differences over and immediately re-compare the workspaces.

Copy to Left

Exercise

Sven

Sven created a workspace to do attribute cleanup on 3-1-1 call data, the non-emergency number that municipalities in Canada and the United States use to manage service requests. A few weeks later a colleague modified his workspace to summarize the call records and join them to spatial data, adding feature types and changing transformers. Sven now has two versions and needs to reconcile them into one shared workspace.

In this exercise, you will:

1) Open Starting Workspace

Starting workspace

2) Open the Compare Tool

The Compare tool loads two workspaces side by side so you can see what your colleague changed. The workspace you load as editable is the one you will merge changes into.

Tools > Compare Files

Compare Workspaces dialog filled out

Compare Workspaces open

3) Find a Specific Change

The differences appear in a list below the canvases, grouped by the type of object that changed. Yellow marks an object that exists in both workspaces but differs between them.

FeatureJoiner in list of differences

Finding a differences on both canvases

4) View Changed Parameters

Opening a difference shows that object's parameters from both workspaces side by side. This is where you confirm exactly what changed before you decide to keep it.

'FeatureJoiner' Properties Comparison dialog

5) Select Differences to Copy

The remaining differences all belong to the new workflow that summarizes calls by local area, so you can accept them together. Copying to the left applies the read-only workspace's changes to your editable workspace.

Copy to Left button

Compare Workspaces warning

Runtime Order differences detected dialog

You have now compared two versions of a workspace, confirmed what changed in the FeatureJoiner, and merged the second version's changes into the first. Comparing the two versions this way replaces sending files and screenshots back and forth.

 

Tips and Tricks